<?php
require 'dbcon.php';//链接数据库
$id=(isset($_GET['id']))?$_GET['id']:0;//比较数据库id
$sql="delete from tb_note where id='$id'";//sql删除语句
$num=file_get_contents('./num.txt');
$num=intval($num)+1;
file_put_contents('./num.txt'.$num);
header('HTTP/1.1 204 No Content');
$rs=$db->query($sql);
if($rs==true){
       echo "<script language='javascript' type='text/javascript'>";
       echo "alert('许愿已解除！');";
       echo "window.location.href='index.php'";
       echo "</script>";
}else{
    echo "<script language='javascript'>";
    echo "alert('删除失败！');";
    echo "window.location.href='index.php'";
    echo "</script>";
}
$db->close();